package eafit.sicom.calculadorapromedios;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;

public class ConfirmDeleteAllDialog extends Activity {

	public static final String CONFIRM_DELETE = "CONFIRM_DELETE";

	private Button okBtn;
	private Button cancelBtn;

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);

		setContentView(R.layout.custom_dialog);

		okBtn = (Button) findViewById(R.id.okDeleteAll);
		cancelBtn = (Button) findViewById(R.id.cancel);
		okBtn.setOnClickListener(new OnClickListener() {
			public void onClick(View v) {
				returnConfirm();
			}
		});

		cancelBtn.setOnClickListener(new OnClickListener() {
			public void onClick(View v) {
				cancelDialog();
			}
		});

		getWindow().setFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND,
				WindowManager.LayoutParams.FLAG_BLUR_BEHIND);

	}

	private void returnConfirm() {
		Intent resultIntent = new Intent(this, MainActivity.class);
		resultIntent.putExtra(CONFIRM_DELETE, true);
		setResult(Activity.RESULT_OK, resultIntent);
		finish();
	}

	private void cancelDialog() {
		finish();
	}

}
